package com.example.medemo01;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn;
    private Button btn1;
    private Button btn2;
    private Button btn3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn = findViewById(R.id.btn_qq_login);
        btn1 = findViewById(R.id.btn_qq_sign);
        btn2 = findViewById(R.id.btn_tb_login);
        btn3 = findViewById(R.id.btn_tb_sign);
        btn.setOnClickListener(this);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        Intent intent = null;
        switch (id){
            case R.id.btn_qq_sign:
                intent = new Intent(getApplicationContext(),QQ_Sign.class);
                break;
            case R.id.btn_qq_login:
                intent = new Intent(getApplicationContext(),QQLogin.class);
                break;
            case R.id.btn_tb_login:
                intent = new Intent(getApplicationContext(),Tb_Login.class);
                break;
            case R.id.btn_tb_sign:
                intent = new Intent(getApplicationContext(),Tb_Sign.class);
                break;
        }
        startActivity(intent);
    }
}